\hypertarget{class_r_t_o_s_1_1waitable}{\section{R\-T\-O\-S\-:\-:waitable Class Reference}
\label{class_r_t_o_s_1_1waitable}\index{R\-T\-O\-S\-::waitable@{R\-T\-O\-S\-::waitable}}
}


abstract thing that a task can wait for  




{\ttfamily \#include $<$p\-R\-T\-O\-S.\-h$>$}

Inheritance diagram for R\-T\-O\-S\-:\-:waitable\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.255814cm]{class_r_t_o_s_1_1waitable}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{class_r_t_o_s_1_1waitable_a44ac71980592721bc03e076acc7e8c67}{clear} (void)
\begin{DoxyCompactList}\small\item\em clear the waitable \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_r_t_o_s_1_1waitable_a5a5bf9012a332a6451ee10728153908a}{waitable} (\hyperlink{class_r_t_o_s_1_1task}{task} $\ast$\hyperlink{class_r_t_o_s_1_1task}{task}, const char $\ast$name)
\begin{DoxyCompactList}\small\item\em constructor, specify owner and name \end{DoxyCompactList}\item 
\hypertarget{class_r_t_o_s_1_1waitable_a3a72bdf94092471e82ba2d04cdc4a58e}{void \hyperlink{class_r_t_o_s_1_1waitable_a3a72bdf94092471e82ba2d04cdc4a58e}{set} (void)}\label{class_r_t_o_s_1_1waitable_a3a72bdf94092471e82ba2d04cdc4a58e}

\begin{DoxyCompactList}\small\item\em set the waitable \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_r_t_o_s_1_1waitable_a0ee29d8961a0b67cea2c3fa76da116da}{class {\bfseries waitable\-\_\-set}}\label{class_r_t_o_s_1_1waitable_a0ee29d8961a0b67cea2c3fa76da116da}

\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}


\subsection{Detailed Description}
abstract thing that a task can wait for 

The operation \hyperlink{class_r_t_o_s_1_1waitable_a44ac71980592721bc03e076acc7e8c67}{clear()} is provided (virtual, the default only clears the waitable) \hyperlink{class_r_t_o_s_1_1waitable_a3a72bdf94092471e82ba2d04cdc4a58e}{set()} is provided but private (not all waitables can be set by the user).

Waitable is an abstract class (there are no objects that are just a waitable). \hyperlink{class_r_t_o_s_1_1flag}{flag}, \hyperlink{class_r_t_o_s_1_1timer}{timer}, \hyperlink{class_r_t_o_s_1_1clock}{clock} and \hyperlink{class_r_t_o_s_1_1channel}{channel} are concrete classes that inherit from waitable. A waitable is always created for a particular task. A maximum of 31 waitables can be created for each task. (Actually the maximum is 32, but one waitable created internally to implement the sleep() call.) A waitable can be two states\-: set or cleared. A waitable is initially cleared.

A task can wait for one, a subset, or all waitables created for it. The default is to wait for all waitables created for the task, the other variants are specified by supplying to the task\-:wait() call either a single waitable, or the sum (operator+) of the waitables you want to wait for. When one of the waitables that is waited for is or becomes set the wait() call clears that waitable and returns an event that compares equal to the waitable. (Note that some waitables, for instance the channel, can immediately set itself again.) The calling task can compare that event to the waitables to see which event happened. When more than one of the waited-\/for waitables is set the wait() call makes an arbitrary choice from these waitables. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_r_t_o_s_1_1waitable_a5a5bf9012a332a6451ee10728153908a}{\index{R\-T\-O\-S\-::waitable@{R\-T\-O\-S\-::waitable}!waitable@{waitable}}
\index{waitable@{waitable}!RTOS::waitable@{R\-T\-O\-S\-::waitable}}
\subsubsection[{waitable}]{\setlength{\rightskip}{0pt plus 5cm}R\-T\-O\-S\-::waitable\-::waitable (
\begin{DoxyParamCaption}
\item[{{\bf task} $\ast$}]{task, }
\item[{const char $\ast$}]{name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}}\label{class_r_t_o_s_1_1waitable_a5a5bf9012a332a6451ee10728153908a}


constructor, specify owner and name 

The name is used for debugging only. 

\subsection{Member Function Documentation}
\hypertarget{class_r_t_o_s_1_1waitable_a44ac71980592721bc03e076acc7e8c67}{\index{R\-T\-O\-S\-::waitable@{R\-T\-O\-S\-::waitable}!clear@{clear}}
\index{clear@{clear}!RTOS::waitable@{R\-T\-O\-S\-::waitable}}
\subsubsection[{clear}]{\setlength{\rightskip}{0pt plus 5cm}virtual void R\-T\-O\-S\-::waitable\-::clear (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{class_r_t_o_s_1_1waitable_a44ac71980592721bc03e076acc7e8c67}


clear the waitable 

This is automatically doen when the waitable causes a \hyperlink{class_r_t_o_s_1_1task_a6fc603d0f1c8a94813586d3dfd123fcc}{task\-::wait()} call to return it. 

Reimplemented in \hyperlink{class_r_t_o_s_1_1channel_afd8cd81a91225ed144fc1ca20f3cd8f6}{R\-T\-O\-S\-::channel$<$ T, S\-I\-Z\-E $>$}, \hyperlink{class_r_t_o_s_1_1channel_afd8cd81a91225ed144fc1ca20f3cd8f6}{R\-T\-O\-S\-::channel$<$ Sound\-Event, 50 $>$}, \hyperlink{class_r_t_o_s_1_1channel_afd8cd81a91225ed144fc1ca20f3cd8f6}{R\-T\-O\-S\-::channel$<$ Log\-Line, 50 $>$}, and \hyperlink{class_r_t_o_s_1_1clock_a90d7c2b274fff1b43a1de08e742c41c3}{R\-T\-O\-S\-::clock}.



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
p\-R\-T\-O\-S.\-h\item 
p\-R\-T\-O\-S.\-cpp\end{DoxyCompactItemize}
